package com.ruoyi.member.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.member.domain.BmSpecification;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.member.mapper.BmInordergoodslistMapper;
import com.ruoyi.member.domain.BmInordergoodslist;
import com.ruoyi.member.service.IBmInordergoodslistService;

/**
 * #订单详情信息Service业务层处理
 *
 * @author ruoyi
 * @date 2023-08-03
 */
@Service
public class BmInordergoodslistServiceImpl implements IBmInordergoodslistService
{
    @Autowired
    private BmInordergoodslistMapper bmInordergoodslistMapper;

    /**
     * 查询#订单详情信息
     *
     * @param id #订单详情信息主键
     * @return #订单详情信息
     */
    @Override
    public List<BmInordergoodslist> selectBmInordergoodslistById(Long orderCode)
    {
        return bmInordergoodslistMapper.selectBmInordergoodslistById(orderCode);
    }

    /**
     * 查询#订单详情信息列表
     *
     * @param bmInordergoodslist #订单详情信息
     * @return #订单详情信息
     */
    @Override
    public List<BmInordergoodslist> selectBmInordergoodslistList(BmInordergoodslist bmInordergoodslist)
    {
        return bmInordergoodslistMapper.selectBmInordergoodslistList(bmInordergoodslist);
    }

    /**
     * 新增#订单详情信息
     *
     * @param bmInordergoodslist #订单详情信息
     * @return 结果
     */
    @Override
    public int insertBmInordergoodslist(BmInordergoodslist bmInordergoodslist)
    {
        return bmInordergoodslistMapper.insertBmInordergoodslist(bmInordergoodslist);
    }

    /**
     * 修改#订单详情信息
     *
     * @param bmInordergoodslist #订单详情信息
     * @return 结果
     */
    @Override
    public int updateBmInordergoodslist(BmInordergoodslist bmInordergoodslist)
    {
        return bmInordergoodslistMapper.updateBmInordergoodslist(bmInordergoodslist);
    }

    /**
     * 批量删除#订单详情信息
     *
     * @param ids 需要删除的#订单详情信息主键
     * @return 结果
     */
    @Override
    public int deleteBmInordergoodslistByIds(Long[] ids)
    {
        return bmInordergoodslistMapper.deleteBmInordergoodslistByIds(ids);
    }

    /**
     * 删除#订单详情信息信息
     *
     * @param id #订单详情信息主键
     * @return 结果
     */
    @Override
    public int deleteBmInordergoodslistById(Long id)
    {
        return bmInordergoodslistMapper.deleteBmInordergoodslistById(id);
    }

    @Override
    public int changeGoodsStock(BmSpecification bmSpecification) {
        return bmInordergoodslistMapper.changeGoodsStock(bmSpecification);
    }

    /**
    * @Description: 根据订单编号删除
    * @Param:
    * @return:
    * @Author: huang
    * @Date: 2023/8/11
    */
    @Override
    public int deleteByOrderCode(String orderCode) {
        return bmInordergoodslistMapper.deleteByOrderCode(orderCode);
    }

    /**
     * @Description: 根据订单编号查询规格和购买数量
     * @Param:
     * @return:
     * @Author: huang
     * @Date: 2023/8/11
     */
    @Override
    public List<BmInordergoodslist> selectByOrderCode(String orderCode) {
        return bmInordergoodslistMapper.selectByOrderCode(orderCode);
    }

    /**
     * @Description: 根据规格id添加库存
     * @Param:
     * @return:
     * @Author: huang
     * @Date: 2023/8/11
     */
    @Override
    public int addStock(BmInordergoodslist bmInordergoodslist) {
        return bmInordergoodslistMapper.addStock(bmInordergoodslist);
    }
}
